package openmarket.dao.impl;

import java.sql.SQLException;

import openmarket.dao.PageDAO;
import openmarket.dao.SqlMapConf;
import openmarket.dao.dataobject.PageDO;

public class PageDAOImpl implements PageDAO {

	public void addPage(PageDO pageDO) throws SQLException {
		SqlMapConf.getInstance().insert("addPage", pageDO);
	}

	public void deletePageByPageId(long pageId) throws SQLException {
		SqlMapConf.getInstance().delete("deletePageByPageId", new Long(pageId));
	}

	public PageDO getPageByPageId(long pageId) throws SQLException {
		return (PageDO) SqlMapConf.getInstance().queryForObject(
				"getPageByPageId", new Long(pageId));
	}

	public void updatePageByPageId(PageDO pageDO) throws SQLException {
		SqlMapConf.getInstance().update("updatePageByPageId", pageDO);
	}

}
